home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Small Eiffel 0.4.8 / misc / bootstrap < prev    next >
Text File  |  1997-01-03  |  4KB  |  138 lines

  1. #!/bin/tcsh -f
  2. # Boostrapping script.
  3. #
  4. # Usage : bootstrap [args_for_compile]
  5. #
  6. # For example to try a bootstrap on a small machine using gcc :
  7. #
  8. #                bootstrap -gcc -boost 
  9. #
  10. # For example to try a bootstrap on a big machine using cc :
  11. #
  12. #                bootstrap -cc -check_all
  13. #
  14. ###################################################################
  15. #set verbose=1
  16. cd ${SmallEiffel}/bin
  17. /bin/rm -f compile_to_c[1-3] compile_to_c.make
  18. echo "Compile compile command"
  19. set cmd="./compile -c_code -o compile.new $* COMPILE make"
  20. echo $cmd
  21. $cmd
  22. if (!(-f compile.new)) then
  23.     echo "Cannot Compile compile" 
  24.     exit 1
  25. else
  26.     mv -f compile.new compile
  27. endif
  28. ###################################################################
  29. echo "Try to compute compile_to_c1 with compile"
  30. /bin/rm -f compile_to_c.make
  31. set cmd="compile -c_code -o compile_to_c1 $* COMPILE_TO_C make"
  32. echo $cmd
  33. $cmd
  34. if (!(-f compile_to_c1)) then
  35.     echo "Bad bootstrap (cannot produce compile_to_c1)."
  36.       exit 1
  37. endif
  38. ###################################################################
  39. echo "Try to compute compile_to_c2 with compile_to_c1"
  40. /bin/rm -f compile_to_c.make
  41. set cmd="compile_to_c1 -o compile_to_c2 $* COMPILE_TO_C make"
  42. echo $cmd
  43. $cmd
  44. if (!(-f compile_to_c.make)) then
  45.     echo "Bad bootstrap (cannot produce compile_to_c.make)."
  46.       exit 1
  47. endif
  48. set verbose=1
  49. source compile_to_c.make
  50. unset verbose
  51. if (!(-f compile_to_c2)) then
  52.     echo "Bad bootstrap (cannot produce compile_to_c2)."
  53.       exit 1
  54. endif
  55. ###################################################################
  56. echo "Try to compute compile_to_c3 with compile_to_c2"
  57. /bin/rm -f compile_to_c.make
  58. set cmd="compile_to_c2 -o compile_to_c3 $* COMPILE_TO_C make"
  59. echo $cmd
  60. $cmd
  61. if (!(-f compile_to_c.make)) then
  62.     echo "Bad bootstrap (cannot produce compile_to_c.make)."
  63.       exit 1
  64. endif
  65. set verbose=1
  66. source compile_to_c.make
  67. unset verbose
  68. if (!(-f compile_to_c3)) then
  69.     echo "Bad bootstrap (cannot produce compile_to_c3)."
  70.       exit 1
  71. endif
  72. ###################################################################
  73. ./clean same_files >& /dev/null
  74. /bin/rm -f same_files
  75. ./compile same_files -boost -o same_files -O2 >& /dev/null
  76. if (!(-f same_files)) then
  77.     echo "Cannot Compile same_files" 
  78.     exit 1
  79. endif
  80. set diff="./same_files"
  81. if (-f /usr/bin/bdiff) then
  82.     set diff="/usr/bin/bdiff"
  83. endif
  84. set cmd="${diff} compile_to_c2 compile_to_c3"
  85. echo $cmd
  86. $cmd
  87. if ($status) then
  88.    echo "Bootstrap not correct (compile_to_c2/compile_to_c3)."
  89.    exit 1
  90. endif
  91. echo "Bootstrap correct."
  92. echo "compile_to_c2 seems to be a good one."
  93. #######################################
  94. echo "Basic test of the new version."
  95. mv -f compile_to_c compile_to_c.old
  96. mv -f compile_to_c2 compile_to_c
  97. echo "Compute misc/self_test in file 'self_test.out'."
  98. ${SmallEiffel}/misc/self_test >! self_test.out
  99. diff self_test.out ${SmallEiffel}/misc/self_test.good_output
  100. if ($status) then
  101.    mv -f compile_to_c.old compile_to_c
  102.    echo "Bad self_test."
  103.    exit 1
  104. endif
  105. /bin/rm -f compile_to_c.old 
  106. echo "Good Self Test."
  107. ${SmallEiffel}/lib_msg/self_test
  108. echo "Install New Version."
  109. cd ${SmallEiffel}/bin_c
  110. /bin/rm -f ${SmallEiffel}/bin_c/*
  111. cp ../bin/loadpath.se .
  112. # Small commands :
  113. foreach cmd (compile finder clean)
  114.     echo Compiling $cmd
  115.     ../bin/compile_to_c -o $cmd $cmd make -boost -no_split -O2 >! /dev/null
  116.     if (!(-f ${cmd}.make)) then
  117.         echo Error when compiling ${cmd}
  118.         exit 1
  119.     endif
  120. end
  121. # Big commands :
  122. foreach cmd (compile_to_c eval pretty)
  123.     echo Compiling $cmd
  124.     ../bin/compile_to_c -o $cmd $cmd make -boost -no_split -O3 >! /dev/null
  125.     if (!(-f ${cmd}.make)) then
  126.         echo Error when compiling ${cmd}
  127.         exit 1
  128.     endif
  129.     mv ${cmd}.make ${cmd}.big
  130.     ../bin/compile_to_c -o $cmd $cmd make -boost -O2 >! /dev/null
  131.     if (!(-f ${cmd}.make)) then
  132.         echo Error when compiling ${cmd}
  133.         exit 1
  134.     endif
  135. end
  136. /bin/rm -f loadpath.se
  137. echo "New Version Installed."
  138.